import filecmp
import os

def compare_folders(folder1, folder2):
    # 获取文件夹1和文件夹2中的所有文件列表
    files1 = set(os.listdir(folder1))
    files2 = set(os.listdir(folder2))

    # 找出文件夹1和文件夹2中不同的文件
    unique_files1 = files1 - files2
    unique_files2 = files2 - files1

    # 输出哪些文件是不同的
    print("Files unique to", folder1, ":", unique_files1)
    print("Files unique to", folder2, ":", unique_files2)


# 指定要比较的两个文件夹路径
folder1 = "/home/champrin/Desktop/MV-CS016-10UC+DA1041860/给预备役/json_annotations (copy)/侧面正面完整/左/中/红/ori"
folder2 = "/home/champrin/Desktop/MV-CS016-10UC+DA1041860/给预备役/json_annotations (copy)/侧面正面完整/左/中/红/merged_annotations"


# 执行比较
compare_folders(folder1, folder2)